if x != 0: |
x = x - 1 |
printDown(8) |
print(x) |
def printDown(x): |
printDown(x) |
    if x != 0: |
    x = x - 1 |
printDown(8) |
    print(x) |
def printDown(x): |
        printDown(x) |
1 | def printDown(x): |
2 |     print(x) |
3 |     x = x - 1 |
4 |     if x != 0: |
5 |         printDown(x) |
6 | printDown(8) |
a = a * 2 |
doubleNumber(10,4) |
def doubleNumber(a,b): |
doubleNumber(a,b) |
b = b - 1 |
print(a) |
if b != 0: |
    a = a * 2 |
doubleNumber(10,4) |
def doubleNumber(a,b): |
        doubleNumber(a,b) |
    b = b - 1 |
    print(a) |
    if b != 0: |
1 | def doubleNumber(a,b): |
2 |     a = a * 2 |
3 |     print(a) |
4 |     b = b - 1 |
5 |     if b != 0: |
6 |         doubleNumber(a,b) |
7 | doubleNumber(10,4) |
doubleNumber(a,b) |
print(a) |
if b != 0: |
a = a * 2 |
else: |
doubleNumber(10,4) |
b = b - 1 |
def doubleNumber(a,b): |
        doubleNumber(a,b) |
        print(a) |
    if b != 0: |
    a = a * 2 |
    else: |
doubleNumber(10,4) |
    b = b - 1 |
def doubleNumber(a,b): |
1 | def doubleNumber(a,b): |
2 |     a = a * 2 |
3 |     b = b - 1 |
4 |     if b != 0: |
5 |         doubleNumber(a,b) |
6 |     else: |
7 |         print(a) |
8 | doubleNumber(10,4) |
a = a * 2 |
if a < b: |
def doublingUntil(a,b): |
doublingUntil(a,b) |
print(a) |
doublingUntil(5,200) |
    a = a * 2 |
    if a < b: |
def doublingUntil(a,b): |
        doublingUntil(a,b) |
        print(a) |
doublingUntil(5,200) |
1 | def doublingUntil(a,b): |
2 |     a = a * 2 |
3 |     if a < b: |
4 |         print(a) |
5 |         doublingUntil(a,b) |
6 | doublingUntil(5,200) |
arr.pop(0) |
if arr != []: |
printArrayItems(arr) |
print(arr[0]) |
printArrayItems([1,2,3]) |
def printArrayItems(arr): |
    arr.pop(0) |
    if arr != []: |
        printArrayItems(arr) |
    print(arr[0]) |
printArrayItems([1,2,3]) |
def printArrayItems(arr): |
1 | def printArrayItems(arr): |
2 |     print(arr[0]) |
3 |     arr.pop(0) |
4 |     if arr != []: |
5 |         printArrayItems(arr) |
6 | printArrayItems([1,2,3]) |
totalItems(arr,t) |
totalItems([1,2,3]) |
arr.pop(0) |
print(t) |
t = t + arr[0] |
if arr != []: |
else: |
def totalItems(arr,t=0): |
        totalItems(arr,t) |
totalItems([1,2,3]) |
    arr.pop(0) |
        print(t) |
    t = t + arr[0] |
    if arr != []: |
    else: |
def totalItems(arr,t=0): |
1 | def totalItems(arr,t=0): |
2 |     t = t + arr[0] |
3 |     arr.pop(0) |
4 |     if arr != []: |
5 |         totalItems(arr,t) |
6 |     else: |
7 |         print(t) |
8 | totalItems([1,2,3]) |
def binaryConvert(num, t=0): |
print(t) |
if num != "": |
binaryConvert("10101111") |
if num[0] == "1": |
t = t + 2 ** (len(num) - 1) |
else: |
num = num[1:] |
binaryConvert(num,t) |
def binaryConvert(num, t=0): |
        print(t) |
    if num != "": |
binaryConvert("10101111") |
    if num[0] == "1": |
        t = t + 2 ** (len(num) - 1) |
    else: |
    num = num[1:] |
        binaryConvert(num,t) |
1 | def binaryConvert(num, t=0): |
2 |     if num[0] == "1": |
3 |         t = t + 2 ** (len(num) - 1) |
4 |     num = num[1:] |
5 |     if num != "": |
6 |         binaryConvert(num,t) |
7 |     else: |
8 |         print(t) |
9 | binaryConvert("10101111") |
else: |
denaryConvert(new,a) |
if new != 0: |
a = str(rem) + a |
rem = num % 2 |
print(a) |
new = num //2 |
denaryConvert(6) |
def denaryConvert(num,a=""): |
    else: |
        denaryConvert(new,a) |
    if new != 0: |
    a = str(rem) + a |
    rem = num % 2 |
        print(a) |
    new = num //2 |
denaryConvert(6) |
def denaryConvert(num,a=""): |
1 | def denaryConvert(num,a=""): |
2 |     new = num //2 |
3 |     rem = num % 2 |
4 |     a = str(rem) + a |
5 |     if new != 0: |
6 |         denaryConvert(new,a) |
7 |     else: |
8 |         print(a) |
9 | |
10 | denaryConvert(6) |
11 |